<?php
if(isset($_SESSION['QuyenHan']))
{
	if(isset($_GET['id']))
	$MaVanBanDen = $_GET['id'];
	$vanbanden = new vanbandenbs();
	$vanbanden->MaVanBanDen = $MaVanBanDen;
	$danhsach = $vanbanden->GetList();
?>

<div id="NoiDung" class="form">
  <h3  class="text-primary">Chi tiết văn bản <?php echo $danhsach[0]['SovaKyHieu']?></h3>
  <table class="table table-bordered table-hover" >
    <tbody >
      <tr>
        <td width="150px"><span>
          <label>Số và ký hiệu: </label>
          </span></td>
        <td><span> <?php echo $danhsach[0]['SovaKyHieu']?> </span></td>
      </tr>
      <tr>
        <td width="150px"><span>
          <label>Trích yếu: </label>
          </span></td>
        <td><span> <?php echo $danhsach[0]['TrichYeu']?> </span></td>
      </tr>
      <tr>
        <td width="150px"><span>
          <label>Ngày ban hành: </label>
          </span></td>
        <td><span> <?php echo InNgay($danhsach[0]['NgayBanHanh']) ?> </span></td>
      </tr>
      <tr>
        <td width="150px"><span>
          <label>Ngày hết hạn: </label>
          </span></td>
        <td><span> <?php echo InNgay($danhsach[0]['NgayHetHan']) ?> </span></td>
      </tr>
      <tr>
        <td width="150px"><span>
          <label>Loại văn bản: </label>
          </span></td>
        <td><span> <?php echo $danhsach[0]['TenLoaiVanBan']?> </span></td>
      </tr>
      <tr>
        <td width="150px"><span>
          <label>Nơi ban hành: </label>
          </span></td>
        <td><span> <?php echo $danhsach[0]['NoiBanHanh']?> </span></td>
      </tr>
      <tr>
        <td width="150px"><span>
          <label>Ngày đến: </label>
          </span></td>
        <td><span> <?php echo InNgay($danhsach[0]['NgayDen']) ?> </span></td>
      </tr>
      <tr>
        <td width="150px"><span>
          <label>Trạng thái: </label>
          </span></td>
        <td><span>
          <?php  echo $danhsach[0]['TenTrangThai'] ?>
          </span></td>
      </tr>
      <?php
		
            	if( $danhsach[0]['MaTrangThai'] != 1)
				{
					$nguoiduyet = new nguoidungbs();
					$nguoiduyet->MaNguoiDung = $danhsach[0]['MaNguoiDuyet'];
					$nguoiduyet = $nguoiduyet->GetList();
			?>
      <tr>
        <td width="150px"><span>
          <label>Người duyệt: </label>
          </span></td>
        <td><span>
          <?php  echo $nguoiduyet[0]['TenNguoiDung'] ?>
          </span></td>
      </tr>
      <tr>
        <td width="150px"><span>
          <label>Thơi gian duyệt: </label>
          </span></td>
        <td><span>
          <?php  echo $danhsach[0]['ThoiGianDuyet'] ?>
          </span></td>
      </tr>
      <?php } ?>
      <tr>
        <td width="150px"><span>
          <label>File đính kèm: </label>
          </span></td>
        <td><span>
          <?php
							$filevb = new filevanbanbs();
							$filevb->MaVanBanDen = $danhsach[0]['MaVanBanDen'];
							$dsfile = $filevb->GetList();
							for($i=0; $i<count($dsfile);$i++)
							{
								
						  		echo "<a href=".$dsfile[$i]['Path']."><span class='glyphicon glyphicon-save'> ".$dsfile[$i]['TenFileVanBan']."</span></a> </br>" ;
								
							}
							?>
          </span></td>
      </tr>
    </tbody>
  </table>
</div>
<?php
}else
{
	ThongBaoLoi("Vui lòng đăng nhập !");
}

?>
